#ifndef POLYMERIZATION_H_
#define  POLYMERIZATION_H_

class node
{
public:
    node();
    ~node();
    int getorder() const;
    void setorder(int rorder);
    int getcoefficient() const;
    void setcoefficient(int rcoefficient);
    node* getnext() const;
    void setnext(node * rnext);
private:
    int m_order;
    double m_coefficient;
    node * m_next;
};
class polymerization
{
public:
    polymerization();
    explicit polymerization(polymerization * temp);
    ~polymerization();
    void addend(node * temp);
    void setpoly(int first,...);//first is the total number of input
    node * getfirst() const;
    node * gettial() const;
    void copytoend(node * temp);
    polymerization * operator+(const polymerization &addpoly)   const;
    void operator =(polymerization * temp);
    polymerization * operator*(const polymerization & timepoly)  const;
    double substitute(double  x)const;
    void show();
private:
    node* m_first;
    node* m_tial;
};


#endif // SINGLELINK_H_
